package Stringlei;

public class Stringwork {
   /* public static void main(String[] args) {
        String str1 = "word";
        String[] str2 = {"1","2","3"};
        String str3 = "[";
        for (int i = 0; i < str2.length; i++) {
            if(i!=str2.length-1) {
                str3 = str3.concat(str1).concat(str2[i]).concat("#");
            }
            else {
                str3 = str3.concat(str1).concat(str2[i]).concat("]");
            }
        }
        System.out.println(str3);
    }*/
   public static void main(String[] args) {
       int[] array = {1,2,3,4,5};
       System.out.println(stringconact(array));
   }
   public static String stringconact(int[] array)
   {
       String str="[";
       for (int i = 0; i < array.length; i++) {
           if(i!=array.length-1)
           {
               str=str+"word"+array[i]+"#";
           }
           else
           {
               str=str+"word"+array[i]+"]";
           }
       }
       return str;
   }
}

